package com.scar1et.Prototype;

import com.scar1et.Prototype.resume.PersonalInfo;
import com.scar1et.Prototype.resume.Resume;
import com.scar1et.Prototype.resume.WorkExperience;

import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 * 客户端
 * Created by scar1et on 15-10-26.
 */
public class Main {
    public static void main(String[] args) {
        String yesOrNo = "y";
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while ("y".equalsIgnoreCase(yesOrNo)) {
            try {
                PersonalInfo personalInfo = new PersonalInfo();
                personalInfo.setAge(24);
                personalInfo.setSex("男");
                personalInfo.setName("叶科阳");
                WorkExperience workExperienceA = new WorkExperience();
                workExperienceA.setTimeArea("2011 - 2015");
                workExperienceA.setCompanyName("成都理工大学");

                Resume resumeA = new Resume();
                resumeA.setPersonalInfo(personalInfo);
                resumeA.setWorkExperience(workExperienceA);
                resumeA.display();

                WorkExperience workExperienceB = (WorkExperience) workExperienceA.clone();
                workExperienceB.setTimeArea("2014 - 20XX");
                workExperienceB.setCompanyName("成都懒宝网络科技有限公司");
                Resume resumeB = (Resume) resumeA.clone();
                resumeB.setWorkExperience(workExperienceB);

                resumeA.display();
                resumeB.display();

                System.out.println("是否继续？（y/n）");
                yesOrNo = br.readLine().trim();
            } catch (Exception e) {
                e.printStackTrace();
                System.out.println(e.getMessage() + "");
            }
        }
    }
}
